package masterjava.admingui.shared.entity;

import masterjava.common.shared.entity.BaseEntity;

import javax.persistence.*;

/**
 * User: Grigory Kislin
 * Date: 04/07/11
 */
@Entity
@Access(AccessType.PROPERTY)
@Table(name = "USER")
public class UserLogin extends BaseEntity {

    private String login;

    // do not serialized
    transient private Partner partner;

    @Column(name = "LOGIN", nullable = false, unique = true)
    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARTNER_ID", nullable = true)
    public Partner getPartner() {
        return partner;
    }

    public void setPartner(Partner partner) {
        this.partner = partner;
    }

    @Override
    public void prepareToSerialize() {
    }

}
